ab6a8151845dfd01321bd3d9866f33483c5a2141,java/src/org/broadinstitute/sting/gatk/walkers/indels/ConstrainedMateFixingManager.java,ConstrainedMateFixingManager,addRead,#SAMRecord#,167

Before Change


                // middle of the bam file that now belong at the end - and any mapped reads that get emitted
                // after them trigger an exception in the writer.  For our purposes, because we shouldn't be
                // moving read pairs when they are both unmapped anyways, we'll just not run fix mates on them.
                boolean doNotFixMates = newRead.getReadUnmappedFlag() && mate.getReadUnmappedFlag();
                if ( !doNotFixMates ) {

                    boolean reQueueMate = mate.getReadUnmappedFlag() && ! newRead.getReadUnmappedFlag();

After Change


                // arbitrarily far away).  However, we do still want to move legitimately unmapped reads whose
                // mates are mapped, so the compromise will be that if the mate is still in the queue then we'll
                // move the read and otherwise we won't.
                boolean doNotFixMates = newRead.getReadUnmappedFlag() && (mate.getReadUnmappedFlag() || !waitingReads.contains(mate));
                if ( !doNotFixMates ) {

                    boolean reQueueMate = mate.getReadUnmappedFlag() && ! newRead.getReadUnmappedFlag();